function ToggleList(){
	var panel = $(ComboBoxChildren.ListPanel);
	if (panel.style.display == "none"){
		panel.style.display = "";
		var list = $(ComboBoxChildren.List);
		list.focus();
	}else{
		panel.style.display = "none";
	}
	panel.style.position = "absolute";
	SetPanelPosition(panel);
	SetSelectedItem();
}
function SetSelectedItem(){
	var textbox = $(ComboBoxChildren.TextBox);
	var list = $(ComboBoxChildren.List);
	var v = textbox.value;
	for(i = 0; i < list.options.length; i++){
		var op = list.options[i];
		if (op.value === v){
			list.selectedIndex = i;
			break;
		}
	}	
}
function SetPanelPosition(el){
	var textbox = $(ComboBoxChildren.TextBox);
	var img = $(ComboBoxChildren.Image);
	var list = $(ComboBoxChildren.List);
	var pos = getElementPosition(textbox);
	var width = textbox.clientWidth + img.clientWidth;
	el.style.width = width;
	list.style.width = width;
	el.style.top = pos.top + textbox.clientHeight;
	el.style.left = pos.left;
}
function ListClick(){
	var panel = $(ComboBoxChildren.ListPanel);
	var list = $(ComboBoxChildren.List);
	var textbox = $(ComboBoxChildren.TextBox);
	panel.style.display = "none";
	var v = list.options[list.selectedIndex].value;
	textbox.value = v;
}
function TextBoxKeyPress(){
	var list = $(ComboBoxChildren.List);
	list.selectedIndex = -1;
}
function ListBlur(){
	var panel = $(ComboBoxChildren.ListPanel);
	panel.style.display = "none";
}